﻿using System;
using System.Drawing;
using System.Windows.Forms;
using MUnit;

namespace Maze
{
    class TestMazeForm
    {
        SQ[,] squares = {{ SQ.W, SQ.W, SQ.W },
                         { SQ.W, SQ.O, SQ.O },
                         { SQ.W, SQ.S, SQ.W }};
        Board board;
        MazeForm form;

        [Setup]
        void Setup()
        {
            // This will be run once before each test method
            this.board = new Board(this.squares);
            this.form = new MazeForm(this.board);
        }

        [Test]
        void ClientSize()
        {
            Verify.Equals(new Size(400, 400), this.form.ClientRectangle.Size);
        }

        
        [Test]
        void PixelsToSquare()
        {
            Verify.Equals(new Point(3, 4), MazeForm.PixelsToSquare(new Point(3 * MazeForm.SquareSize.Width, 4 * MazeForm.SquareSize.Height)));
        }

        [Test]
        void SquareToPixels()
        {
            Verify.Equals(new Point(3 * MazeForm.SquareSize.Width, 4 * MazeForm.SquareSize.Height), MazeForm.SquareToPixels(new Point(3, 4)));
        }

        [TearDown]
        void TearDown()
        {
            // This will be run once after each test method
        }
    }
}
